#include <iostream>
#include <iomanip>
#include <string.h>
using namespace std;

class student
{
public:
    int score;
    char *name;
    student()
    {
        name = new char[128];
    }
    student(const student &stu)
    {
        score = stu.score;
        name = new char[128];
        strcpy(name, stu.name);
    }
    ~student()
    {
        cout << "我是析构函数" << endl;
        delete[] name;
    }
    student &operator=(const student &stu)
    {
        cout << "我是拷贝赋值运算符" << endl;
        score=stu.score;
        strcpy(name,stu.name);
    }
};
int main()
{
    student stu1;
    stu1.score = 90;
    strcpy(stu1.name, "wangxingxing");
    cout << stu1.name << "  " << stu1.score << endl;
    student stu2 = stu1;
    cout << stu2.name << "  " << stu2.score << endl;
    strcpy(stu1.name, "修改了");
    cout << stu1.name << "  " << stu1.score << endl;
    cout << stu2.name << "  " << stu2.score << endl;
    student stu3;
    stu3=stu1;
    cout << stu3.name << "  " << stu3.score << endl;
    
    return 0;
}